package com.bootdo.common.utils;

import java.io.IOException;
import java.util.List;

import org.apache.http.client.ClientProtocolException;

import net.sf.json.JSONObject;

public class GetUserList {
	
	/**
	 * @param args
	 * @throws IOException 
	 * @throws ClientProtocolException 
	 */
	public static List<String> getUserList(String access_token) throws ClientProtocolException, IOException {
		String url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token="+access_token;
		String result = HttpUtil.doGet(url, null);
		JSONObject resultJson = JSONObject.fromObject(result); 
		JSONObject data = (JSONObject) resultJson.get("data");
		List<String> openidlist = (List<String>) data.get("openid");
		return openidlist;
	}

}
